package org.rea.GUI;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JLabel;

import org.rea.clock.ClockIcon;

@SuppressWarnings("serial")
public class ClockFrame extends JFrame {

	private ClockIcon _icnClock;
	private JLabel _lblClock;
	private javax.swing.Timer _t;

	public ClockFrame(){

		_icnClock = new ClockIcon();
		_lblClock = new JLabel();
		this.setLayout(new GridLayout(1,0));
		_lblClock.setIcon(_icnClock);
		getContentPane().add(_lblClock);

		_t = new javax.swing.Timer(1000,
				new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				_lblClock.repaint();
			}
		}
				);
		_t.start();
		pack();
	}


	public static void main(String[] args) {

		ClockFrame clockWindow = new ClockFrame();
		clockWindow.setVisible(true);


	}

}
